import React from 'react'
import Preload from './Preload'

export default function Style({ name }) {
  return (
    <Preload as={PreloadStyle} name={name} />
  )
}

function PreloadStyle(props) {
  const html = {
    __html: `<style>${props.children}</style>`
  }
  return (
    <div dangerouslySetInnerHTML={html} />
  )
}